<template>
    <div id="zheDang"></div>
    <footer>
        <div>
            应付:￥{{total}}
        </div>
        <div id="btn" @click="jieSuan">提交订单</div>
    </footer>
    <div id="chengGong" ref="jiesuan">
        支付成功!
    </div>
</template>

<script>
    export default {
        name: "PayForFooterCom",
        props:['total'],
        methods:{
            jieSuan(){
                this.$refs.jiesuan.style.display = 'block'
                setTimeout(()=>{
                    this.$refs.jiesuan.style.display = 'none'
                    this.$router.push('/')
                },800)
            }
        }
    }
</script>

<style scoped>
    #zheDang{
        width: 100%;
        height: 50px;
    }
    footer{
        width: 100%;
        height: 50px;
        background-color: #fff;
        position: fixed;
        bottom: 0;
    }
    #btn{
        float: right;
        width: 40%;
        height: 100%;
        background-color: red;
        color: #fff;
        text-align: center;
        line-height: 50px;
    }
    footer>div:nth-child(1){
        width: 60%;
        height: 100%;
        color: red;
        line-height: 50px;
        float: left;
    }
    #chengGong{
        width: 40vw;
        height: 30vw;
        background: #d81e06;
        position: absolute;
        top: 30%;
        left: 30%;
        text-align: center;
        line-height: 30vw;
        border: 3px solid lightgrey;
        border-radius: 3vw;
        display: none;
    }
</style>